package ui;

import javax.swing.*;

public class Index {

    private JFrame frame;

    private RegistForm registForm;

    private LoginForm loginForm;

    private JTabbedPane tabbedPane;

    public Index() {
        frame=new JFrame("用户管理系统");
        registForm=new RegistForm();
        loginForm=new LoginForm();
        tabbedPane=new JTabbedPane();
    }

    private void init(){
        registForm.show();
        tabbedPane.add("注册",registForm.getPanel());

        loginForm.show();
        tabbedPane.add("登录",loginForm.getPanel());

        frame.add(tabbedPane);
    }

    public void show(){
        init();
        frame.setSize(340,440);
        frame.setVisible(true);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        new Index().show();
    }
}
